﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;

namespace University.Workshop.Presentation.Cistern.Register
{
    /// <summary>
    /// Interaction logic for RegisterCisternPrincipalData.xaml
    /// </summary>
    public partial class RegisterCisternPrincipalData : Page, Presenters.Cistern.Register.IRegisterPrincipalView
    {
        Presenters.Cistern.Register.PresenterRegisterCistern pRegisterCistern;
        public RegisterCisternPrincipalData()
        {
            pRegisterCistern = new Presenters.Cistern.Register.PresenterRegisterCistern(this);
            InitializeComponent();
        }

        private void btnRegisterMedicine_Click(object sender, RoutedEventArgs e)
        {
            pRegisterCistern.RegisterCistern();
        }

        private void btnBack_Click(object sender, RoutedEventArgs e)
        {
            pRegisterCistern.GoBackPage();

        }

        private void btnNext_Click(object sender, RoutedEventArgs e)
        {
            pRegisterCistern.GoNextPage();

        }

        private void GoStepOne_Click(object sender, RoutedEventArgs e)
        {

            pRegisterCistern.GoStepOne();
        }

        private void GoStepTwo_Click(object sender, RoutedEventArgs e)
        {
            pRegisterCistern.GoStepTwo();
        }

        private void btnCancelRegister_Click(object sender, RoutedEventArgs e)
        {
            RestartRegisterCistern();
        }

        private void Page_Loaded(object sender, RoutedEventArgs e)
        {
            frmContent.Navigate(new PageFirstStepRegisterCisternView(pRegisterCistern));
            pRegisterCistern.FirstTime();
        }

        public void CallFirstPage ()
        {
            PageSecondStepRegisterCisternView pp = new PageSecondStepRegisterCisternView(pRegisterCistern);
            RegisterBasicValue = pp;
            frmContent.NavigationService.Navigate(pp);
        }

        Presenters.Cistern.Register.IRegisterBasicCisternView RegisterBasicValue;

        public void CallSecondPage()
        {
            PageFirstStepRegisterCisternView pp = new PageFirstStepRegisterCisternView(pRegisterCistern);
            RegisterBasicValue = pp;
            frmContent.NavigationService.Navigate(pp);
            GoStepTwo.IsEnabled = true;
        }

        public void RestartRegisterCistern()
        {
            this.NavigationService.Navigate(new RegisterCisternPrincipalData());
        }

        public Presenters.Cistern.Register.IRegisterBasicCisternView RegisterBasic
        {
            get
            {
                return RegisterBasicValue;
            }
            set
            {
                RegisterBasicValue = value;
            }
        }

        public void SystemMessage(string MessageValue)
        {
            MessageBox.Show(App.Current.MainWindow, MessageValue, "Atencion!!!", MessageBoxButton.OK, MessageBoxImage.Information, MessageBoxResult.OK, MessageBoxOptions.RightAlign);
        }

        public void ErrorMessage(string MessageValue)
        {
            MessageBox.Show(App.Current.MainWindow, MessageValue, "Error!!!",MessageBoxButton.OK, MessageBoxImage.Error, MessageBoxResult.OK,MessageBoxOptions.RightAlign);
        }
    }
}
